#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>

using namespace std;

void test1()
{
	string s1("abcdef");
	string s2(s1);
	string s3(10, '$');
	string s4(s3, 4, 6);

	cout << s1 << endl;
	cout << s2 << endl;
	cout << s3 << endl;
	cout << s4 << endl;
}

void test2()
{
	string s5("1234");
	cout << s5 << endl;

	for (int i = 0; i < s5.size(); ++i)
		s5[i]++;

	cout << s5 << endl;

	for (auto& ch : s5)
		ch--;

	cout << s5 << endl;

	size_t begin = 0, end = s5.size() - 1;

	while (begin < end)
	{
		swap(s5[begin], s5[end]);
		begin++;
		end--;
	}

	cout << s5 << endl;
}

void test3()
{
	string s1("Hello ");
	cout << s1 + "world" << endl;
	cout << s1 << endl;
	s1 += "world";
	cout << s1 << endl;

	string s2("abcdef");
	cout << s2 << endl;
	s2 = s1;
	cout << s2 << endl;

	cout << s2.size() << endl;
}

int main()
{
	//test1();
	//test2();
	test3();

	return 0;
}